package com.huang.weic.controller;

import com.huang.weic.bean.comm;
import com.huang.weic.service.CommService;
import com.huang.weic.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/comm")
public class CommController {
    @Autowired
    private CommService commService;

    @PostMapping("/addComm")
    public R addComm(@RequestBody comm comm){
        commService.save(comm);
        return R.ok();
    }

    @DeleteMapping("/deleteView/{id}")
    public R deleteView(@PathVariable Integer id){
        commService.removeById(id);
        return R.ok();
    }

}
